#插入排序，时间复杂度为o(n*n)，空间复杂度o(1)

import numpy as np
#插入排序
def insert_array(a):
    for i in range(1,len(a)):
        j=i-1
        while(j>=0):
            if(a[j]>a[j+1]):
                #完成交换
                temp=a[j]
                a[j]=a[j+1]
                a[j+1]=temp
            j=j-1
    print(a)
    return a

# #
#设计一个比数器
def make_some_numbers(len,number):
    a=[]
    for i in range(len):

        a.append(int(np.random.randint(1,number)))
    return a

a=make_some_numbers(10,20)
print(a)
insert_array(a)
#
#设计一个比较两个数组的东西
def compare_two_array(a,b):
    if(a==None or b==None or len(a)!=len(b)):
        return False

    for i in range(len(a)):
        if(a[i]!=b[i]):
            return False

    return True
Flage=True
for i in range(500):

    a1=make_some_numbers(9,20)
    a2=insert_array(a1)
    a3=sorted(a1)
    boolen=compare_two_array(a1,a3)
    if(boolen==False):
        Flage=False
        break

if(Flage):
    print("NO BUG")
else:
    print("cnm")